package com.meilai.project.service.business.sale;

import com.baomidou.mybatisplus.extension.service.IService;
import com.meilai.project.dto.business.sale.BillSaleGroupDTO;
import com.meilai.project.dto.business.saleOrder.SaleQueryGroupDTO;
import com.meilai.project.entity.business.sale.BillSaleGroup;
import com.meilai.project.vo.business.sale.BillSaleGroupVO;
import com.meilai.project.vo.business.sale.BillSaleVO;
import com.meilai.project.vo.business.sale.ContractCustomerVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 销售分组表 服务类
 * </p>
 *
 * @author xhy
 * @since 2022-12-05
 */
public interface BillSaleGroupService extends IService<BillSaleGroup> {

    /**
     * 分组关联款项
     *
     * @param dto 数据
     * @return 是否成功
     */
    Boolean relation(BillSaleGroupDTO dto);

    List<BillSaleVO> saleList(Long customer_id);

    List<BillSaleVO> saleListInGroup(Long group_id);

    List<BillSaleGroupVO> selectList();

    /**
     * 根据到款id，查询对应客户下的分组
     */
    List<BillSaleGroupVO> selectListByAccountReceivedId(Long accountReceivedId);

    /**
     * 查询分组
     */
    List<BillSaleGroupVO> selectListByDto(SaleQueryGroupDTO dto);

    ContractCustomerVO getContractAndCustomerByGroupId(Long group_id);

    Map<Long,ContractCustomerVO> getContractAndCustomerByGroupIds(List<Long> group_ids);

    List<BillSaleGroup> listGroup(Long user_id);
}
